#ifndef __SWAP_N_H_
#define __SWAP_N_H_

#include "stdint.h"
#include "stdlib.h"

#ifdef __cplusplus
extern "C"
{
#endif

	void swap_u8_with_bit(void *p_src, void *p_des, uint16_t Len);
	
	void swap_u16_with_bit(void *p_src, void *p_des, uint16_t Len);
	
	void swap_u32_with_bit(void *p_src, void *p_des, uint16_t Len);

	void swap_u8_with_u4(void *p_src, void *p_des, uint16_t Len);
	
	void swap_u16_with_u4(void *p_src, void *p_des, uint16_t Len);
	
	void swap_u32_with_u4(void *p_src, void *p_des, uint16_t Len);

	void swap_u16_with_u8(void *p_src, void *p_des, uint16_t Len);
	
	void swap_u32_with_u8(void *p_src, void *p_des, uint16_t Len);

	void swap_u64_with_u8(void *p_src, void *p_des, uint16_t Len);

	void swap_list_with_u8(void *p_src, void *p_des, uint16_t Len);
	
	void swap_list_with_u16(void *p_src, void *p_des, uint16_t Len);
	
	void swap_list_with_u32(void *p_src, void *p_des, uint16_t Len);
	
	void swap_bit_map_u8(void *p_src, void *p_des);
	
	void swap_bit_map_u16(void *p_src, void *p_des);
	
	void swap_bit_map_u32(void *p_src, void *p_des);

	void swap_bit_map_bn(void *p_src, void *p_des, uint16_t n);

	void swap_bit_map_u32_alloc(void *p_src, void *p_des);

	void swap_bit_map_u8_multi(void *p_src, void *p_des, size_t groups);
	void swap_bit_map_u16_multi(void *p_src, void *p_des, size_t groups);
	void swap_bit_map_u32_multi(void *p_src, void *p_des, size_t groups);
	void swap_bit_map_u32_alloc_multi(void *p_src, void *p_des, size_t groups);
	void swap_bit_map_bn_multi(void *p_src, void *p_des, uint16_t n, size_t groups);

	uint16_t bit16_roll_shift_left(uint16_t dat, uint8_t bit_len, uint8_t shift);
	uint16_t bit16_roll_shift_right(uint16_t dat, uint8_t bit_len, uint8_t shift);

	void u16_list_roll_shift_right(uint16_t *pdat, uint16_t len, uint8_t shift);
	void u16_list_roll_shift_left(uint16_t *pdat, uint16_t len, uint8_t shift);

	void swap_cbit_map_u32(void *p_src, void *p_des, uint8_t row, uint8_t cs);
	void swap_cbit_map_u16(void *p_src, void *p_des, uint8_t row, uint8_t cs);
	void swap_cbit_map_u8(void *p_src, void *p_des, uint8_t row, uint8_t cs);

#ifdef __cplusplus
}
#endif

#endif 
